package com.morty.config.handler;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class MybatisAutoHandler implements MetaObjectHandler {

    @Override
    public void insertFill(MetaObject metaObject) {
        log.info("come to insert fill .........");
        if(metaObject.hasSetter("proCode")) {
            this.strictInsertFill(metaObject, "proCode", String.class,"3");
        }
    }

    @Override
    public void updateFill(MetaObject metaObject) {
    }
}